<template>
	<view class="me">
		<view class="userInfoBox">
			<text class="iconfont icon-shezhi rightSheZi " > </text>
			<image v-if="userInfo==null" src="../../static/images/loginBgImg.png" class="bgImage"></image>
			<image v-if="userInfo" :src="userInfo.profile_image" class="bgImage"></image>
			<view class="left"  v-if="userInfo==null">
				<text class="icon-zhucedenglutouxiang iconfont loginPhoto" @tap.stop="toLogin"></text>
				<text style="margin: 20upx 0;">未登陆</text>
				<text style="font-size: 28upx;">点击头像登陆</text>
			</view>
			<view class="left" v-if="userInfo!=null">
				<image :src="userInfo.profile_image" class="userPhoto"></image>
				<text style="margin: 20upx 0;color: white;" >{{userInfo.username}}</text>
				<text style="color: white;font-size: 26upx;">{{userInfo.introduction||"这家伙很懒，什么也没有留下"}}</text>
			</view>
			<view class="right">
				<text class="iconfont icon-qianbi"></text>
				<text>编辑</text>
			</view>
		</view>
		<!-- 中间的粉丝区-->
		<view class="centerfenS">
			<view>
				<text>{{userInfo?userInfo.fans_count:0}}</text>
				<text>粉丝</text>
			</view>
			<view>
				<text>{{userInfo?userInfo.follow_count:0}}</text>
				<text>关注</text>
			</view>
			<view>
				<text>{{userInfo?userInfo.level:0}}</text>
				<text>等级</text>
			</view>
		</view>
		<!-- 贴子 评论 收藏 -->
		<view class="centerArea">
			<view class="item">
				<text class="iconfont icon-wodetiezi"></text>
				我的贴子
			</view>
			<view class="item">
				<text class="iconfont icon-huifu1"></text>
				我的评论
			</view>
			<view class="item">
				<text class="iconfont icon-shoucang"></text>
				我的收藏
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState,mapGetters} from "vuex";
	export default {
		data() {
			return {

			};
		},
		computed:{
			...mapGetters(["userInfo"])
		},
		methods:{
			toLogin(){
				uni.navigateTo({
					url:"/pages/login/login"
				});
			}
		}
	}
</script>

<style scoped>
	page {
		background-color:#ECECEC;
	}

	.userInfoBox {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 50upx 20upx;
		align-items: center;
		position: relative;
		overflow: hidden;
		z-index: 1;
	}

	.userInfoBox .left {
		display: flex;
		flex-direction: column;
		align-items: center;
		font-family: "microsoft yahei";
		max-width: 250upx;
		/* text-align: center; */
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.loginPhoto {
		font-size: 120upx;
		color: rgba(0, 0, 0, 0.3);
	}

	.userInfoBox .right {
		background-color: rgba(0, 0, 0, 0.3);
		color: lightgray;
		padding: 20upx 35upx;
		border-radius: 50upx;
		font-size: 28upx;

	}

	.bgImage {
		position: absolute;
		left: 0px;
		top: 0px;
		width: 100%;
		height: 100%;
		filter: blur(30px);
		z-index: -1;
	}

	.centerfenS {
		display: flex;
		width: 100%;
		justify-content: space-around;
		background-color: white;
		margin-bottom: 10upx;
		padding: 20upx 0upx;
		font-size: 28upx;
	}

	.centerfenS>view {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.centerfenS>view>text:first-child {
		font-weight: bold;
		margin-bottom: 5upx;
	}

	.centerfenS>view>text:last-child {
		color: gray;
	}
	.centerArea{
		background-color: white;
		font-size: 32upx;
		box-sizing: border-box;
		padding-left: 20upx;
	}
	.centerArea .item{
		padding-top: 20upx;
		padding-bottom: 20upx;
		border-bottom: 1px solid #f2f2f2;
	}
	.centerArea .item .iconfont{
		color: gray;
	}
	.rightSheZi{
		position: absolute;
		right: 20upx;
		top: 20upx;
		font-size: 48upx;
		color: white;
	}
	.userPhoto{
		width: 120upx;
		height: 120upx;
		display: block;
		border-radius: 60upx;
	}

</style>
